<%@ include file="/WEB-INF/jsp/include.jsp"%>

<%@ page import="org.acegisecurity.ui.AbstractProcessingFilter"%>
<%@ page import="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter"%>
<%@ page import="org.acegisecurity.AuthenticationException"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="spring" uri="/spring"%>
<html>
<head>
<title><fmt:message key="msg.app.title" /></title>

</head>
<body>
<center>
	<c:if test="${not empty param.login_error}">
		<font color="red">
        Your login attempt was not successful, try again.<BR><BR>
        Reason: <%= ((AuthenticationException) session.getAttribute(AbstractProcessingFilter.ACEGI_SECURITY_LAST_EXCEPTION_KEY)).getMessage() %>
      </font>
	</c:if> 
	<form action="<c:url value='j_acegi_security_check'/>" method="POST">
		<table width="50%" border="0">
			<tr>
				<td align="center" bgcolor="lightblue">Log on</td>
			</tr>
			<tr>
				<td>
				<table border="0" width="100%">
					<tr>
						<td width="33%" align="right">Username:</td>
						<td width="66%" align="left"><!-- input type="text" name="usrid" value="" -->
							<input type='text' name='j_username' <c:if test="${not empty param.login_error}">value='<c:out value="${ACEGI_SECURITY_LAST_USERNAME}"/>'</c:if>>
						</td>
					</tr>
					<tr>
						<td width="33%" align="right">Password:</td>
						<td width="66%" align="left">
							<input type='password' name='j_password'>
						</td>
					</tr>
					<tr>
						<td colspan="2"  align="center"><input type="checkbox" name="_acegi_security_remember_me">
							Don't ask for my password for two weeks
						</td>
					</tr>
					<tr>
						<td align="right" ><input type="submit" align="middle" value="Login"></td>
						<td> <input name="reset" type="reset"></td>	
					</tr>
				</table>
				</td>
			</tr>
		</table>
	</form>
</center>
</body>
</html>
